home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / pnm2ppa.postinst < prev    next >
Text File  |  2008-06-09  |  2KB  |  79 lines

  1. #! /bin/sh
  2. # postinst script for pnm2ppa
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6.  
  7. # Variables
  8. CONFFILE="/etc/pnm2ppa.conf"
  9. CONFTMPL="/usr/share/pnm2ppa/pnm2ppa.conf"
  10. MKMAGIC="/usr/share/pnm2ppa/update-magicfilter"
  11.  
  12. # Debconf, baby -- no tests.  It's a dependency for installation.
  13. . /usr/share/debconf/confmodule
  14.  
  15. case "${1}" in
  16.     configure)
  17.     # Make sure we have a config file in place
  18.     if [ ! -f ${CONFFILE} ] ; then
  19.         /usr/bin/install -m644 ${CONFTMPL} ${CONFFILE}
  20.     fi
  21.  
  22.     db_get pnm2ppa/use_debconf
  23.     if [ "${RET}" = "true" ] ; then
  24.         # If conf file already exists, use that
  25.         if [ -f ${CONFFILE} ] ; then
  26.             CONFSRC=${CONFFILE}
  27.         else
  28.             CONFSRC=${CONFTMPL}
  29.         fi
  30.  
  31.         # VERY simple sed replacement
  32.         if [ -f ${CONFSRC} ] ; then
  33.             db_get pnm2ppa/printer_model
  34.             TEMPFILE=`/bin/tempfile`
  35.             # Replace everything following "version " w/model
  36.             /bin/sed -e "s,^\(version \).*$,\1 ${RET}," ${CONFSRC} > \
  37.                 ${TEMPFILE}
  38.             /usr/bin/install -m644 ${TEMPFILE} ${CONFFILE}
  39.             /bin/rm ${TEMPFILE}
  40.         fi
  41.  
  42.         # Simple magicfilter processing...
  43.         db_get pnm2ppa/create_magicfilter
  44.         if [ "${RET}" = "true" ] ; then
  45.             sh $MKMAGIC
  46.         fi
  47.     fi
  48.  
  49.     ;;
  50.     abort-upgrade|abort-remove|abort-deconfigure)
  51.     ;;
  52.     *)
  53.         echo "postinst called with unknown argument \`${1}'" >&2
  54.         exit 1
  55.     ;;
  56. esac
  57.  
  58. # dh_installdeb will replace this with shell code automatically
  59. # generated by other debhelper scripts.
  60.  
  61. # Automatically added by dh_installdocs
  62. if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
  63.     install-docs -i /usr/share/doc-base/pnm2ppa-color
  64. fi
  65. # End automatically added section
  66. # Automatically added by dh_installdocs
  67. if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
  68.     install-docs -i /usr/share/doc-base/pnm2ppa-calibrate
  69. fi
  70. # End automatically added section
  71. # Automatically added by dh_installdocs
  72. if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
  73.     install-docs -i /usr/share/doc-base/pnm2ppa-ppa-networking
  74. fi
  75. # End automatically added section
  76.  
  77.  
  78. exit 0
  79.